<?php
function UI_printMenu()
{
    echo "<li><a href=\"index.php\">Home <img alt='Homepage' src='images/home.png'/></a></li>";
    if (!isset($_SESSION['uid']) || $_SESSION['uid'] == -1) {
        echo "<li><a href=\"login.php\">Login</a></li>";
        echo "<li><a href=\"register.php\">Register</a></li>";
    }
    else {
        echo "<li><a href=\"profile.php?page=content\">Manage Content</a></li>";
        echo "<li><a href=\"profile.php?page=categories\">My Categories</a></li>";
        echo "<li><a href=\"profile.php\">My Profile <img alt='Profile' src='images/profile.png'/></a></li>";
        if ( isset($_SESSION['uid']) && $_SESSION['uid'] == 1 && isset($_SESSION['username']) && $_SESSION['username'] == "admin" ) {
            echo "<li><a href=\"admin.php\"><span style=\"color: red\">Administration page</span></a></li>";
        }
        echo "<li><a href=\"logout.php\">Logout <img alt='Logout' src='images/logout.png'/></a></li>";
    }
    echo "<li><a href=\"help.php\">Help</a></li>";
}
?>
<script type="text/javascript">
$(document).ready(function()
{
  var originalFontSize = $('html').css('font-size');
    $("#fontRes").click(function(){
        $('html').css('font-size', originalFontSize);
  });

  $("#fontInc").click(function(){
    var currentFontSize = $('html').css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize);
    var newFontSize = currentFontSizeNum * 1.1;
    if ( newFontSize <= 20)
        $('html').css('font-size', newFontSize);
    return false;
  });

  $("#fontDec").click(function(){
    var currentFontSize = $('html').css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize);
    var newFontSize = currentFontSizeNum * 0.95;
    if ( newFontSize >= 13)
        $('html').css('font-size', newFontSize);
    return false;
  });
});
</script>
    <div id="headerWrapper">
        <div id="logo">
            <a href="index.php"><img alt="uCompare logo" id="logo-img" src="images/logo.png" name="logo-img" /></a>
        </div>

        <div id="topBanner">
                <form id="search" name="search" method="post" action="search.php">
                    <div id="searchWrapper" style="width: 378px; overflow: hidden;">
                        <input style="width: 308px; height: 28px;" id="searchInput" name="search_query" type="text" />
                        <input style="float: right" id="search_submit" type="image" alt="Search!" src="images/search.png" />
                    </div>
                    <script type="text/javascript"> document.search.search_query.focus() </script>
                    <div id="searchFilters" style='margin-top: 5px;'>
                        Search for:
                        <input style="margin-left: 10px;" id="filter1" name="filt_categories" type="checkbox" value="categories"  checked="checked" /> Categories
                        <input style="margin-left: 10px;" id="filter2" name="filt_categories2" type="checkbox" value="entities" checked="checked" /> Entities
                    </div>
                </form>

                <div id="fontControls" style="float:right">
                    <a id="fontInc"><img alt="Increase font size" src="images/fontInc.png"/></a>
                    <a id="fontRes"><img alt="Reset font size" src="images/fontRes.png"/></a>
                    <a id="fontDec"><img alt="Decrease font size" src="images/fontDec.png"/></a>
                </div>

                <div id="hmenu">
                    <ul id="nav">
                        <?php UI_printMenu(); ?>
                    </ul>
                </div>
        </div>
    </div>

	<div id="contentWrapper">
<?php
    UI_printErrors();
?>